local info = debug.getinfo(1, "S") -- 第二个参数 "S" 表示仅返回 source,short_src等字段， 其他还可以 "n", "f", "I", "L"等 返回不同的字段信息
local path = info.source
path = string.sub(path, 2, -1) -- 去掉开头的"@"
path = string.match(path, "^.*\\") -- 捕获最后一个 "/" 之前的部分 就是我们最终要的目录部分
-- path = string.sub(path,1,#path-1)
-- path = string.match(path, "^.*\\")
-- print("dir=", path)
path = path .. "?.lua;"
package.path = path.. package.path 

local GraphEdge = require("GraphEdge")
--导航图
local NavGraphEdge = class(GraphEdge)

function NavGraphEdge:ctor(from,to,cost,flags,id)
  -- //examples of typical flags
  -- enum
  -- {
  --   normal            = 0,
  --   swim              = 1 << 0,
  --   crawl             = 1 << 1,
  --   creep             = 1 << 3,
  --   jump              = 1 << 3,
  --   fly               = 1 << 4,
  --   grapple           = 1 << 5,
  --   goes_through_door = 1 << 6
  -- };
  GraphEdge.ctor(self,from,to,cost)
  self.m_iFlags = flags
  --if this edge intersects with an object (such as a door or lift), then
  --this is that object's ID. 
  self.m_iIDofIntersectingEntity = id
end

function NavGraphEdge:print()
  self.super.print(self)
  print("NavGraphEdge->",self.m_iFlags,self.m_iIDofIntersectingEntity)
end

function NavGraphEdge:setFlags(flags )
  self.m_iFlags = flags
end
function NavGraphEdge:getFlags()
  return self.m_iFlags
end

function NavGraphEdge:setId(id)
  self.m_iIDofIntersectingEntity = id
end
function NavGraphEdge:getId( ... )
  return self.m_iIDofIntersectingEntity
end

-------------------[[
	local edge = NavGraphEdge.new(1,2,1,1,1)
	edge:print()

--]]


return NavGraphEdge